
<!-- saved from url=(0026)/test.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<title>骡窝窝问答,解决旅行问题,基于旅游的问答分享平台 - 骡窝窝</title>
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui,viewport-fit=cover">
	<meta name="format-detection" content="telephone=no,address=no">
	<style>
		.container{
			width: 100%;
		}
		.commentbox{
			width: 100%;
			margin: 20px auto;
		}
		.mytextarea {
			width: 100%;
			overflow: auto;
			word-break: break-all;
			height: 100px;
			color: #000;
			font-size: 1em;
			resize: none;
		}
		.comment-list{
			width: 100%;
			margin: 20px auto;
			clear: both;
			padding-top: 20px;
		}
		.comment-list .comment-info{
			position: relative;
			margin-bottom: 20px;
			margin-bottom: 20px;
			border-bottom: 1px solid #ccc;
		}
		.comment-list .comment-info header{
			width: 10%;
			position: absolute;
		}
		.comment-list .comment-info header img{
			width: 100%;
			border-radius: 50%;
			padding: 5px;
		}
		.comment-list .comment-info .comment-right{
			padding:5px 0px 5px 11%;
		}
		.comment-list .comment-info .comment-right h3{
			margin: 5px 0px;
		}
		.comment-list .comment-info .comment-right .comment-content-header{
			height: 25px;
		}
		.comment-list .comment-info .comment-right .comment-content-header span,.comment-list .comment-info .comment-right .comment-content-footer span{
			padding-right: 2em;
			color: #aaa;
		}
		.comment-list .comment-info .comment-right .comment-content-header span,.comment-list .comment-info .comment-right .comment-content-footer span.reply-btn,.send,.reply-list-btn{
			cursor: pointer;
		}
		.comment-list .comment-info .comment-right .reply-list {
			border-left: 3px solid #ccc;
			padding-left: 7px;
		}
		.comment-list .comment-info .comment-right .reply-list .reply{
			border-bottom: 1px dashed #ccc;
		}
		.comment-list .comment-info .comment-right .reply-list .reply div span{
			padding-left: 10px;
		}
		.comment-list .comment-info .comment-right .reply-list .reply p span{
			padding-right: 2em;
			color: #aaa;
		}
		.more-list{ display:block; margin:15px; line-height:35px; background-color:#f0f0f0; text-align:center; color:#999; border-radius:4px; font-size:1.5rem;}

	</style>
	<link href="/css/mobile+css+head_mobile+css+ui^YVw^1526627473.css" rel="stylesheet" type="text/css">

	<link href="/css/new_ask2016.css" rel="stylesheet" type="text/css">
	<!-- 新 Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="/js/plugins/bootstrap-4.1.1-dist/css/bootstrap.min.css">
	<script src="/js/plugins/jquery/jquery.min.js"></script>
	<script src="/js/plugins/form/jquery.form.js"></script>
	<script src="/js/plugins/jrender/jrender.min.js"></script>
	<link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
	<script src="/js/plugins/dialog2/dialog.min.js"></script>
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="/js/plugins/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
	<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" >
	<script src="/js/plugins/jquery/jquery.comment.js"></script>
	<script src="/js/plugins/form/jquery.form.js"></script>
	<script src="/js/common.js"></script>
	<script>
        $(function () {
            var user = JSON.parse(sessionStorage.getItem("user"));


            var params = getParams();
            $("input[name='dailyReview.daily.id']").val(params.dailyId);

            $('#commentForm').ajaxForm(function(data){
				if (data.success){
					location.href="/mine/review.html";
					location.reload();
				}
			})

			$("#comment").click(function(){
                $("#commentForm").attr("action",'/daily/'+user.id+'/dailyReview');
				$("#commentForm").submit();
			});
            var params = getParams();
            if(params.dailyId) {
                $.get("/daily/" + params.dailyId+"/dailyReview", function (data) {
                    console.log(data);
                    $('.comment-list').renderValues(data,{
                        getHref:function (item,value) {
                            var href = $(item).data("href");
                            $(item).attr("href",href+value);
                        }
                    });
                })
            }

            //首先我们需要获取当前页的标签
            var currentInput = $('#currentPage');
            //因为我们手机滚动之前的数据就没有了,只有当前查出来的不合理
            var arr=[];
            var pages=1;
            function query() {
                //获取当前页
                var currentPage = currentInput.val();
                $.get("/daily/"+params.dailyId + "/dailyReview",{currentPage:currentPage},function (data) {
                    pages=data.pages;
                    //把两个数组的数据合并在一起,就可以滚动了
                    $.merge(arr,data.list);
                    var json = {list:arr};
                    $('.comment-list').renderValues(json,{
                        getHref:function (item,value) {
                            var href = $(item).data("href");
                            $(item).attr("href",href+value);
                        }
                    });
                });

                currentInput.val(parseInt(currentPage)+1);
            }
            query();
            $('._j_add_more_button').click(function () {
                var currentPage = currentInput.val();
                if(currentPage<=pages){
                    query();
                }else{
                    $(document).dialog({
                        type : 'notice',
                        infoText: '没有更多评论了!!!',
                        autoClose: 1000
                    });
                }
            })
        });
	</script>
</head>
<body>
<a href="javascript:history.go(-1);" style="position: absolute;top: 10px;left: 22px;">
	<span><i class="fa fa-chevron-left fa-2x" style="color: black;"></i></span>
</a>
<br/>
<div id="question" class="container-fluid">

	<input type="hidden" id="currentPage" name="currentPage" value="1">
	<div class="container-fluid">
		<form id="commentForm" method="post">
			<div class="commentbox">
				<textarea cols="80" rows="50" placeholder="来说几句吧......" class="mytextarea" id="content" name="dailyReview.dailyReviews"></textarea>
				<div class="btn btn-info pull-right" id="comment">评论</div>
				<input type="hidden" name="dailyReview.daily.id">
			</div>
		</form>
		<br/>

		<div class="comment-list">
			<div render-loop="list">
				<div class="comment-info">
					<a data-href="/userProfiles.html?id=" render-key="list.user.id" render-fun="getHref">
						<header><img render-src="list.user.headImgUrl" ></header>
					</a>
					<div class="comment-right">
						<h3 render-html="list.user.nickName"></h3>
						<div class="comment-content-header"><i class="fa fa-clock-o fa-lg"></i><span render-html="list.reviewTime"></span><i class="fa fa-map-marker fa-lg"></i><span render-html="list.user.place"></span></div>
						<p class="content" render-html="list.dailyReviews"></p>
						<div class="comment-content-footer">
							<div class="row">
								<div class="col-md-2"><span class="reply-btn">回复</span></div>
							</div>
						</div>
						<div class="reply-list"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div style="margin-bottom: 65px;">
	<a class="more-list _j_add_more_button">更多评论</a>
</div>
</body>
</html>